On Effect Analysis for Programs with Callbacks

نویسندگان

  • Etienne Kneuss
  • Viktor Kuncak
  • Philippe Suter
چکیده

We introduce a precise interprocedural effect analysis for programs with mutable state, dynamic object allocation, and dynamic dispatch. Our analysis is precise even in the presence of dynamic dispatch where the context-insensitive estimate on the number of targets is very large. This feature makes our analysis appropriate for programs that manipulate first-class functions (callbacks). We first present a framework in which programs are enriched with special effect statements, and define the semantics of both program and effect statements as relations on states. Our framework defines a program composition operator that is sound with respect to relation composition. Computing the summary of a procedure then consists of composing all its program statements to produce a single effect statement. We propose a strategy for applying the composition operator in a way that balances precision and efficiency. We instantiate this framework with a domain for tracking read and write effects, where relations on program states are abstracted as graphs. We implemented the analysis as a plugin for the Scala compiler. We analyzed the Scala standard library containing 58K methods and classified them into several categories according to their effects. Our analysis proves that over one half of all methods are pure. We also analyze how context sensitivity and composition operator application strategies impact the analysis precision and performance.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Modular Heap Analysis for Higher-Order Programs

We consider the problem of computing summaries for procedures that soundly capture the effect of calling a procedure on program state that includes a mutable heap. Such summaries are the basis for a compositional program analysis and key to scalability. Higher order procedures contain callbacks (indirect calls to procedures specified by callers). The use of such callbacks and higherorder featur...

متن کامل

Precise and Scalable Analysis of Programs with Callbacks

Our work is in the area of automated verification of software properties in modern programing languages. We present three papers related to various aspects of our research field: a modular pointer and effect analysis for object oriented programs, a precise and efficient typestate analysis, and a precise, parametric array content analysis. We discuss their contributions as well as their shortcom...

متن کامل

Effect Analysis for Programs with Callbacks

We introduce a precise interprocedural effect analysis for programs with mutable state, dynamic object allocation, and dynamic dispatch. Our analysis is precise even in the presence of dynamic dispatch where the context-insensitive estimate on the number of targets is very large. This feature makes our analysis appropriate for programs that manipulate first-class functions (callbacks). We prese...

متن کامل

A Meta-Analysis on the Effectiveness of Parental Education Programs on Children Externalizing Disorder

Objectives: The aim of the current meta-analysis was to determine the effectiveness of parent education programs on children's externalized disorders. This research, using the meta-analysis technique and by integrating the results of various researches, determines the size of the effect of parent education programs. Method: A total of 21 acceptable methodologies were selected and meta-analysis...

متن کامل

Semantics of Asynchronous JavaScriptTechnical report, 2017-07-26

The Node.js runtime has become a major platform for developers building cloud, mobile, or IoT applications using JavaScript. Since the JavaScript language is single threaded, Node.js programs must make use of asynchronous callbacks and event loops managed by the runtime to ensure applications remain responsive. While conceptually simple, this programming model contains numerous subtleties and b...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2012